

//Problem code FAKETSP
import java.math.BigDecimal;
import java.util.*;
public class Spoj03 {

    public static void main(String args[]){
        
        Scanner scanner = new Scanner (System.in);
        Scanner linescanner;
        Double convert;

        double xold=0;
        double yold=0;
        double D=0;
        int i=1;//this is use to make sure no printing is done on the first run
        
        while(true){
        	
        	if(scanner.hasNextLine()){
            String line = scanner.nextLine();
            linescanner=new Scanner(line);
            linescanner.next();
            String finish = linescanner.next();

            
            convert= new Double(line.substring(line.lastIndexOf("(")+1,line.lastIndexOf(",")));
            double x=convert.doubleValue();

            convert= new Double(line.substring(line.lastIndexOf(",")+1,line.lastIndexOf(")")));
            double y = convert.doubleValue();

            if(i==1){ //using i to set initial values
                xold=x;
                yold=y;
            }
            else{

            	if(yold==y){
            		D=D+Math.abs(x-xold);
            		yold=y;
            		xold=x;
            	}
            	else if(xold==x){
            		   D=D+Math.abs(yold-y);
            			yold=y;
            			xold=x;
            		 }
                
            	else{
            		   D=D+Math.sqrt(((xold-x)*(xold-x)) + ((yold-y)*(yold-y)));
            		   yold=y;
            		   xold=x;
            		}
            	}
                if(i==0){
                	BigDecimal value = new BigDecimal(D);
                	BigDecimal ans=value.setScale(3, BigDecimal.ROUND_DOWN);
                	System.out.println("The salesman has traveled a total of "+ans+" kilometers.");	
                }
            	if(i==1){ //setting i to zero allow results to be printed
            		i=i-1;
            	}
        }
        	else break;
      }
   }
}